<template>
  <div id="app">
    <!-- 导航栏 -->
    <van-nav-bar
      :title="$route.name"
      left-text="首页"
      @click-left="onClickLeft"
      @click-right="onClickRight"
    >
      <template #right>
        <van-icon name="search" size="18" />
      </template>
    </van-nav-bar>
    <!-- 展示 -->
    <router-view :search-show='searchShow'></router-view>
  </div>
</template>

<script>
export default {
  name: "App",
  components: {},
  data() {
    return {
      title:'首页',
      searchShow:false
    };
  },
  methods: {
    onClickLeft() {
      this.$router.push({path:'/home'})
      this.$router.go(0)
    },
    //展示搜索框
    onClickRight(){
      this.searchShow=!this.searchShow
    }
  },
};
</script>

<style>
</style>
